macro(add_imported_library_interface name include)
    add_library(${name} INTERFACE IMPORTED)
    #message("Adding ${include} as interface directories to ${name}")
    set_target_properties(${name} PROPERTIES INTERFACE_INCLUDE_DIRECTORIES "${include}")
endmacro(add_imported_library_interface)

macro(add_imported_library name type lib include)
    # Workaround from https://cmake.org/Bug/view.php?id=15052
    #file(MAKE_DIRECTORY "${include}")
    #message("Name is: " ${name} ", type is " ${type} ", lib is " ${lib} ", include is " ${include})

    if("${lib}" STREQUAL "")
        if("${type}" STREQUAL "SHARED")
        	#message(STATUS "Add imported library 1:  ${name} ${type} IMPORTED" )
            #add_library(${name} INTERFACE IMPORTED)
            add_library(${name} SHARED IMPORTED GLOBAL)
            set_target_properties(${name} PROPERTIES INTERFACE_INCLUDE_DIRECTORIES "${include}")
        else()
        	#message(STATUS "Add imported library 2:  ${name} ${type} IMPORTED" )
        	#add_library(${name} INTERFACE IMPORTED)
        	add_library(${name} STATIC IMPORTED GLOBAL)
            set_target_properties(${name} PROPERTIES INTERFACE_INCLUDE_DIRECTORIES "${include}")
        endif()
    else()
    	#message(STATUS "Add imported library 3:  ${name}_${type} ${type} IMPORTED" )
        add_library(${name}_${type} ${type} IMPORTED GLOBAL)
        set_target_properties(${name}_${type} PROPERTIES IMPORTED_LOCATION "${lib}")
        set_target_properties(${name}_${type} PROPERTIES INTERFACE_INCLUDE_DIRECTORIES "${include}")
    endif()

endmacro(add_imported_library)